package org.pubflex.tests{

      import com.adobe.xml.syndication.atom.Entry;
      
      import flexunit.framework.*;
      
      import org.pubflex.ModelUtility;
                	         
      public class XmlTest extends TestCase {
  		
  	    public function XmlTest( methodName:String ) {
   			super( methodName );
        }
  	  	
  	  	public static function suite():TestSuite {
   			var ts:TestSuite = new TestSuite();
        	ts.addTest( new XmlTest( "testEntryCreation" ) );
        	ts.addTest( new XmlTest( "testCanItWork" ) );
   			return ts;
   		}


        public function testCanItWork():void{
               //var entry:Entry = new Entry();               
        }
  	  		
  		public function testEntryCreation():void{      		    
  		   var xml:XML =  ModelUtility.createNewEntry();  		      		                                                       
            assertNotNull(xml);
            
            
           var test:XML=  <service aaa:base="http://localhost" xmlns="http://www.w3.org/2007/app" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:aaa="http://www.w3.org/XML/1998/namespace">
                      ISM Test Service Document
                      <workspace>
                        <atom:title type="text">ServiceCatalog</atom:title>
                        <collection href="D9D01E18C713902AEB118559480946878">
                          <atom:title type="text">myservices</atom:title>
                            </collection>
                          </workspace>
                    </service>;
                    
                    trace();
                    var a:Object;
                    trace(test.namespaceDeclarations().length)
                    assertTrue(test.namespaceDeclarations().length == 3);
                    for each (a in test.namespaceDeclarations()){
                        trace(a);
                    }
                    
                    assertNotNull(test);
            
  		}
      }
}